using System;
using System.Runtime.InteropServices;
namespace BMC.ARSystem
{
	[ClassInterface, ComVisible(false), Guid("a92e9a0d-b821-42ba-a935-880f4e909eef"), ProgId("BMC.ARSystem.Limit")]
	public abstract class Limit
	{
		public Limit()
		{
		}
		internal Limit(object[] rawData, Server server)
		{
		}
		internal static Limit createInstance(object[] rawData, Server server)
		{
			int[] indexSpec = new int[1];
			uint num = Convert.ToUInt32(Util.GetAt(rawData, indexSpec));
			uint num2 = num;
			switch (num2)
			{
			case 2u:
				return (Limit)ARTypeMgr.Instance.ObjectFromVariant(typeof(IntegerLimit), rawData[1], server);
			case 3u:
				return (Limit)ARTypeMgr.Instance.ObjectFromVariant(typeof(RealLimit), rawData[1], server);
			case 4u:
				return (Limit)ARTypeMgr.Instance.ObjectFromVariant(typeof(CharacterLimit), rawData[1], server);
			case 5u:
				return new DiaryLimit(rawData, server);
			case 6u:
			case 8u:
				return (Limit)ARTypeMgr.Instance.ObjectFromVariant(typeof(SelectionLimit), rawData[1], server);
			case 7u:
				return new DateTimeLimit(rawData, server);
			case 9u:
				break;
			case 10u:
				return (Limit)ARTypeMgr.Instance.ObjectFromVariant(typeof(DecimalLimit), rawData[1], server);
			case 11u:
				return (Limit)ARTypeMgr.Instance.ObjectFromVariant(typeof(AttachmentLimit), rawData[1], server);
			case 12u:
				return (Limit)ARTypeMgr.Instance.ObjectFromVariant(typeof(CurrencyLimit), rawData[1], server);
			case 13u:
				return (Limit)ARTypeMgr.Instance.ObjectFromVariant(typeof(DateOnlyLimit), rawData[1], server);
			case 14u:
				return new TimeOnlyLimit(rawData, server);
			default:
				switch (num2)
				{
				case 33u:
					return (Limit)ARTypeMgr.Instance.ObjectFromVariant(typeof(TableLimit), rawData[1], server);
				case 34u:
					return (Limit)ARTypeMgr.Instance.ObjectFromVariant(typeof(ColumnLimit), rawData[1], server);
				}
				break;
			}
			return new NullLimit();
		}
	}
}
